feat: add glob pattern expansion to CLI find search paths and environment directories (Fixes #354)#362
Merged
karthiknadig merged 1 commit intomainfrom Feb 26, 2026
Merged
Conversation
…ment directories (Fixes #354)
Test Coverage Report (Linux)
Coverage unchanged. |
Performance Report (Linux) ➖
Legend
|
Performance Report (Windows) ✅
Legend
|
Test Coverage Report (Windows)
Coverage decreased. Please add tests for new code. |
Performance Report (macOS)
Legend
|
There was a problem hiding this comment.
Pull request overview
Adds CLI parity with the JSONRPC server by expanding glob patterns in pet find configuration inputs, so quoted globs and env-var-provided globs work as expected.
Changes:
- Expand glob patterns in
search_pathswhen buildingConfigurationfor the CLIfindcommand. - Expand glob patterns in
environment_directorieswhen buildingConfiguration.
Comments suppressed due to low confidence (1)
crates/pet/src/lib.rs:150
- With glob expansion,
search_pathscan become empty when the user explicitly provides only glob patterns that match nothing (or invalid patterns). In that case this code will now fall back to addingcwd, which changes the prior semantics where explicitsearch_pathsdisabled the default cwd behavior. Consider only defaulting tocwdwhenoptions.search_pathsisNone(not provided), not when it was provided but expanded to zero matches.
if search_paths.is_empty() {
if let Ok(cwd) = env::current_dir() {
search_paths.push(cwd);
}
}
eleanorjboyd
approved these changes
Feb 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Expands glob patterns in
search_pathsandenvironment_directorieswhen constructing the configuration for thefindCLI command, using theexpand_glob_patternsutility frompet-fs.expand_glob_patternsonsearch_pathsandenvironment_directoriesincreate_config()findandresolvecommands (with env var fallbacks) #353Fixes #354